import {get,post} from '../../utils/request'
const state={
  //用来保存查询出来的栏目信息
  waiterBill:[],
  total:0
}

const actions={
  //查询所有栏目信息
  findAllwaiterBill(context,list){
    //异步操作
    get('/account/pageQueryEmployeeAccount',list).then(res=>{
      let response=res.data.list
      context.commit('setwaiterBill',response)
      let total=res.data.total
      context.commit('setTotal',total)
    })
  },

  //保存栏目信息
//   saveCategory(context,list){       
//     let respone=post('/productCategory/saveOrUpdate',list)
//     return respone
//   },

//   //删除栏目信息
//   deleteCategory(context,list){
//     let respone=get('/productCategory/deleteById',list)
//     return respone
//   }
}

const mutations={
  //修改state中的值
  setwaiterBill(state,response){
    state.waiterBill=response
  },
  setTotal(state,total){
    state.total=total
  }
}

export default{
  namespaced:true,
  state,
  actions,
  mutations
}